Skip to content

Fix assetIds decoding: return 400 instead of 500 on malformed JSON#511

Merged
s-heppner merged 1 commit into
eclipse-basyx:developfrom
rwth-iat:fix/b9-asset-id-key-error
May 8, 2026
Merged

Fix assetIds decoding: return 400 instead of 500 on malformed JSON#511
s-heppner merged 1 commit into
eclipse-basyx:developfrom
rwth-iat:fix/b9-asset-id-key-error

Conversation

@zrgt

@zrgt zrgt commented May 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #502

Changes

  • Wrap asset_dict["name"] / asset_dict["value"] in a try/except KeyError and raise BadRequest with a descriptive message — client input validation errors must return 4xx, not 5xx
  • Add test_malformed_asset_id_missing_field_returns_400 unit test using Werkzeug test client

@s-heppner s-heppner merged commit f2ef2c1 into eclipse-basyx:develop May 8, 2026
15 checks passed
@s-heppner s-heppner deleted the fix/b9-asset-id-key-error branch May 8, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants